from flask import render_template
from flask import request

class FlaskIO:
	def defaultOutput(self, lodger):
		return lodger.output()

	def output(self, items):
		return render_template('lodger.tpl', items=items)

	def inputField(self, field, fio=None, default=None):
		return request.form.get(field, default)
	
	def outputItem(self, item):
		return render_template('item.tpl', item=item)

	def editItem(self, item):
		return render_template('form.tpl', item=item)

